<!DOCTYPE html>


<html lang="zh-CN">


<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    一款轻量级，可快速上手的开源后台系统.md |  
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/dist/main.css">

  
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">

  
<link rel="stylesheet" href="/css/custom.css">

  
  
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

  
  

  

</head>

</html>

<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-develop/一款轻量级，可快速上手的开源后台系统"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  一款轻量级，可快速上手的开源后台系统.md
</h1>
 

    </header>
     
    <div class="article-meta">
      <a href="/2020/11/11/develop/%E4%B8%80%E6%AC%BE%E8%BD%BB%E9%87%8F%E7%BA%A7%EF%BC%8C%E5%8F%AF%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B%E7%9A%84%E5%BC%80%E6%BA%90%E5%90%8E%E5%8F%B0%E7%B3%BB%E7%BB%9F/" class="article-date">
  <time datetime="2020-11-10T16:00:00.000Z" itemprop="datePublished">2020-11-11</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/develop/">develop</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">1.2k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">4 分钟</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="一款轻量级，可快速上手的开源后台系统"><a href="#一款轻量级，可快速上手的开源后台系统" class="headerlink" title="一款轻量级，可快速上手的开源后台系统"></a>一款轻量级，可快速上手的开源后台系统</h1><p><a target="_blank" rel="noopener" href="http://www.cnblogs.com/funnyzpc/p/13777881.html">www.cnblogs.com/funnyzpc/p/13777881.html</a></p>
<h3 id="mee-admin开源后台系统"><a href="#mee-admin开源后台系统" class="headerlink" title="mee-admin开源后台系统"></a><strong>mee-admin</strong>开源后台系统</h3><h4 id="Preface"><a href="#Preface" class="headerlink" title="Preface"></a>Preface</h4><p>这是一个开放的时代，我们不能总是把东西揣在口袋里面自己乐呵。</p>
<p>也正如名言所说的“如果你有两块面包，你当用其中一块去换一朵水仙花”，所以，继上一次把我的两个个人项目开源之后今天我再一次把自有的后台页面也开源出来，以回馈整个开源世界。</p>
<h4 id="开源地址"><a href="#开源地址" class="headerlink" title="开源地址"></a>开源地址</h4><p><a target="_blank" rel="noopener" href="https://github.com/funnyzpc/mee-admin">https://github.com/funnyzpc/mee-admin</a></p>
<h4 id="项目结构概述"><a href="#项目结构概述" class="headerlink" title="项目结构概述"></a>项目结构概述</h4><p>mee-admin是由我的个人<code>mee</code>项目开源而来,<code>mee-admin</code>项目是一个前后端一体化的项目,不过在代码上实现了页面与数据分离，是一个非常好的  轻量级后端工程，所以在正式使用时您会发现主体业务部门均是采用json交互，前端页面使用模板工具实现数据展现及编辑</p>
<p>与<code>jeesite</code>不一样，我们不使用<code>jsp+sitmesh+ehcache</code>臃肿化项目</p>
<p>与<code>Spring-Cloud-Platform</code> <code>xboot</code> 不一样,这里不使用<code>vue</code> <code>iview</code> 做前后端分离，也不使用<code>springclooud</code>做集群分布式</p>
<p>所以我的项目更加轻量级，不需要装<code>node</code> 不需要<code>npm</code>打包 需不要安装<code>nginx</code> 同时也不需要编写无聊的mapper接口，不需要单独写增删改….</p>
<p>所以对于企业内部需求开发更是无比的急速</p>
<p>同时，<code>mee-admin</code>只需具有<code>java</code>后端以及一点点<code>javascript</code>开发能力，便可急速上手。搜索Java知音公众号，回复“后端面试”，送你一份Java面试题宝典.pdf</p>
<h4 id="项目技术相关"><a href="#项目技术相关" class="headerlink" title="项目技术相关"></a>项目技术相关</h4><ul>
<li><p>使用<code>springboot 2.3.4.RELEASE</code>作为基础框架</p>
</li>
<li><p>使用<code>mybatis</code>作为<code>dao</code>框架</p>
</li>
<li><p>使用<code>postgreSQL</code> 作为框架DB(可支持<code>Mysql</code>及<code>Oracle</code>)</p>
</li>
<li><p>使用<code>shiro</code>做权限管理</p>
</li>
<li><p>使用<code>Freemarker</code>做页面模板</p>
</li>
<li><p>使用<code>jquery</code> 插件作<code>javascript</code>基本扩展库使用</p>
</li>
<li><p>目前只是一些组件依赖用,建议大多数情况下使用<code>ES5</code>或<code>ES6</code>规范的<code>javascript</code>扩展</p>
</li>
<li><p>使用<code>handlebars</code>做表单及数据模板</p>
</li>
<li><p>使用<code>seajs</code> 做基础模块管理</p>
</li>
<li><p>封装了序列(<code>ID</code>)生成器(支持分布式)</p>
</li>
<li><p><code>SeqGenServiceImpl</code> 序列生成器(支持分布式)</p>
</li>
<li><p><code>SeqGenUtil</code> 普通序列生成器</p>
</li>
<li><p>封装了<code>Jackson</code>的<code>json</code>库，完全可替代<code>fastjson</code></p>
</li>
<li><p>封装了物理分页<code>PhysicalPageInterceptor</code>及逻辑分页<code>LogicalPageIntercepter</code>(两个可任选其一)，完全替代<code>RowBounds</code>及一众分页依赖</p>
</li>
<li><p>封装了<code>Excel</code>及<code>CSV</code>工具</p>
</li>
<li><p><code>ExcelReadUtil</code> EXCEL读工具</p>
</li>
<li><p><code>ExcelWriteUtil</code> EXCEL写工具</p>
</li>
<li><p><code>CSVUtils</code> CSV读工具</p>
</li>
<li><p>简单封装了java8日期工具类 <code>DateUtil</code></p>
</li>
</ul>
<h4 id="项目界面"><a href="#项目界面" class="headerlink" title="项目界面"></a>项目界面</h4><p><strong>登录</strong><br><img src=""></p>
<p><strong>主页</strong><br><img src=""></p>
<p><strong>报表</strong><br><img src=""></p>
<p><strong>基础配置</strong><br><img src=""></p>
<p><strong>编辑及修改</strong><br><img src=""></p>
<p><strong>系统配置</strong><br><img src=""></p>
<h4 id="项目运行及打包"><a href="#项目运行及打包" class="headerlink" title="项目运行及打包"></a>项目运行及打包</h4><ul>
<li><p>本地项目运行</p>
</li>
<li><p>run <code>MeeApplication</code> and program arguments add <code>--spring.profiles.active=dev</code></p>
</li>
<li><p>注dev、test、prod均为pom.xml下配置的环境参数</p>
</li>
<li><p>Fork <code>mee-admin</code></p>
</li>
<li><p>git clone <code>mee-admin</code> to local</p>
</li>
<li><p>init DB table</p>
</li>
<li><p>use Idea IDE open project</p>
</li>
<li><p>auto build dependency</p>
</li>
<li><p>Idea start config</p>
</li>
<li><p>打包及Linux服务器构建脚本,见mee-admin</p>
</li>
<li><p>必须安装maven(方法请自行搜索引擎查找)</p>
</li>
</ul>
<h4 id="项目访问"><a href="#项目访问" class="headerlink" title="项目访问"></a>项目访问</h4><ul>
<li><p>local: <code>http://127.0.0.1/mee/login</code></p>
</li>
<li><p>server: <code>http://[Your DOMAIN or HOST+PORT]/mee/login</code></p>
</li>
</ul>
<h4 id="Notice"><a href="#Notice" class="headerlink" title="Notice"></a>Notice</h4><p>虽整个项目封装的较为完整, 但是对于一些自定义的展示还是需要有一定的前端技能<br>作为补偿，这里大致写了功能开发流程[see:Function flow](#### Function flow),具体的还需要读者具体学习哈~</p>
<h4 id="Function-flow"><a href="#Function-flow" class="headerlink" title="Function flow"></a>Function flow</h4><ul>
<li><p>功能开发流程</p>
</li>
<li><p>添加mybatis SQL xml文件及映射实体类entity</p>
</li>
<li><p>编写控制器controller及业务service代码</p>
</li>
<li><p>编写构建前端页面并添加菜单项</p>
</li>
<li><p>添加依赖js <code>resources/public/module</code> 下</p>
</li>
<li><p>后端添加权限标识<code>@RequiresPermissions(&quot;your_auth_code&quot;)</code></p>
</li>
<li><p>前端(菜单和业务页面)添加权限标识<code>&lt;@shiro.hasPermission &gt;&lt;/@shiro.hasPermission&gt;</code></p>
</li>
<li><p>后台添加菜单项目</p>
</li>
<li><p>后台角色权限分配</p>
</li>
<li><p>js添加对话框或按钮扩展功能(这是难点!)</p>
</li>
</ul>
<p>业务前端js采用模块化依赖并封装了表单著录以及增删改查相应功能，十分便捷，目前对于扩展功能(比如添加一个’重算‘) 需要自定义函数及相应逻辑，具体流程大致如下</p>
<ol>
<li><p>在search-form内定义button控件(一定要有name属性)</p>
</li>
<li><p>在依赖的js文件内的init函数内定义扩展<code>toolbar:&#123; &quot;控件属性名&quot;: 属性名对应函数 &#125;</code></p>
</li>
<li><p>编写相应函数逻辑</p>
</li>
</ol>
<h2 id="另"><a href="#另" class="headerlink" title="另"></a>另</h2><p>琐碎时间想看一些技术文章，可以去公众号菜单栏翻一翻我分类好的内容，应该对部分童鞋有帮助。同时看的过程中发现问题欢迎留言指出，不胜感谢~。另外，有想多了解哪些方面内容的可以留言（什么时候，哪篇文章下留言都行），附菜单栏截图（PS：很多人不知道公众号菜单栏是什么）</p>
<p><img src=""></p>
<p><strong>END</strong>  </p>
<p><img src=""></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br><span class="line">****我知道你 “**在看**”****![](data:image&#x2F;gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg&#x3D;&#x3D;)</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

 
      <!-- reward -->
      
      <div id="reword-out">
        <div id="reward-btn">
          打赏
        </div>
      </div>
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>版权声明： </strong>
          
          本博客所有文章除特别声明外，著作权归作者所有。转载请注明出处！
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://example.com/2020/11/11/develop/%E4%B8%80%E6%AC%BE%E8%BD%BB%E9%87%8F%E7%BA%A7%EF%BC%8C%E5%8F%AF%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B%E7%9A%84%E5%BC%80%E6%BA%90%E5%90%8E%E5%8F%B0%E7%B3%BB%E7%BB%9F/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/develop/" rel="tag">develop</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2020/11/11/develop/%E7%94%A8%20Python%20%E6%93%8D%E4%BD%9C%20Redis%EF%BC%8C%E7%9C%8B%E8%BF%99%E4%B8%80%E7%AF%87%E5%B0%B1%E5%A4%9F%E4%BA%86/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            用 Python 操作 Redis，看这一篇就够了.md
          
        </div>
      </a>
    
    
      <a href="/2020/11/11/redis/Redis%20%E9%AB%98%E5%8F%AF%E7%94%A8%E6%9E%B6%E6%9E%84%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">Redis 高可用架构最佳实践.md</div>
      </a>
    
  </nav>

   
<!-- valine评论 -->
<div id="vcomments-box">
  <div id="vcomments"></div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script>
  new Valine({
    el: "#vcomments",
    app_id: "",
    app_key: "",
    path: window.location.pathname,
    avatar: "monsterid",
    placeholder: "给我的文章加点评论吧~",
    recordIP: true,
  });
  const infoEle = document.querySelector("#vcomments .info");
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
    infoEle.childNodes.forEach(function (item) {
      item.parentNode.removeChild(item);
    });
  }
</script>
<style>
  #vcomments-box {
    padding: 5px 30px;
  }

  @media screen and (max-width: 800px) {
    #vcomments-box {
      padding: 5px 0px;
    }
  }

  #vcomments-box #vcomments {
    background-color: #fff;
  }

  .v .vlist .vcard .vh {
    padding-right: 20px;
  }

  .v .vlist .vcard {
    padding-left: 10px;
  }
</style>

 
     
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2015-2020
        <i class="ri-heart-fill heart_icon"></i> TzWind
      </li>
    </ul>
    <ul>
      <li>
        
        
        
        由 <a href="https://hexo.io" target="_blank">Hexo</a> 强力驱动
        <span class="division">|</span>
        主题 - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>访问人数:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>浏览次数:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="Hexo"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" target="_blank" rel="noopener" href="http://www.baidu.com">百度</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友链</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2019/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="搜索">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    
  </div>
</div>
    
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->


<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->


<link rel="stylesheet" href="/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>


<!-- CanvasBackground -->


    
  </div>
</body>

</html>